<script setup>
import { ref } from "vue";
import { getRole } from "@/utils/store.js";
const props = defineProps({
  id: {
    type: String,
    default: "",
  },
  list:{
    type:Array,
    default:()=>[]
  },
  origin: Array | Object,
  index:{
    type: Number,
    default: 0,
  }
});
const role = computed(()=>{
  return props.list?.find(v=>v.value == props.id)?.label;
});
// getRole(props.id).then((data) => {
//   role.value = data?.find(v=>v.id == props.id)?.roleName;
// });

</script>
<template>
  <span class="" v-if="role"
    >{{ role }}
    <span v-if="props.index < props.origin?.length - 1">、 </span>

  </span>
</template>

<style lang="scss" scoped></style>